var logginInfo;
function getLogginInfo(A) {
	var B = "";
	$.ajax({
		type : "post",
		url : "/api/svc/userIndex.php",
		data : {
			fun : "getLogginInfo"
		},
		success : function(C) {
			if (C.status == "ok") {
				logginInfo = C;
				$("#user").text(logginInfo.username)
			} else {
				alert(C.reason)
			}
			if (A) {
				A(C)
			}
		}
	})
}
function cancelBubbleEvent(A) {
	if (A && A.stopPropagation) {
		A.stopPropagation()
	} else {
		if (A) {
			A.cancelBubble = true
		} else {
			window.event.cancelBubble = true
		}
	}
}
function preventDefaultEvent(A) {
	if (A && A.preventDefault) {
		A.preventDefault()
	} else {
		if (A) {
			A.returnValue = false
		} else {
			window.event.returnValue = false
		}
	}
}
function nova_check_username(B) {
	if (!B) {
		return false
	}
	var A = /[^_\w]+/g;
	return !A.test(B)
}
function nova_check_email(A) {
	if (!A) {
		return false
	}
	var B = /[\-\w]+@[\w]+\.[a-zA-Z]+/g;
	return B.test(A)
}
function nova_check_phone(A) {
	if (!A) {
		return false
	}
	var B = /^[\d]{11}$/g;
	return B.test(A)
}
function nova_check_sn(B) {
	if (!B) {
		return false
	}
	var A = /^[A-N0-9]{4}-[A-F0-9]{4}$/g;
	return A.test(B)
}
function getQueryString(C) {
	var B = new RegExp("(^|&)" + C + "=([^&]*)(&|$)", "i");
	var A = window.location.search.substr(1).match(B);
	if (A != null) {
		return unescape(A[2])
	}
	return null
}
function getMyInfo(B, A) {
	if (B) {
		$.ajax({
			type : "post",
			url : "/api/svc/userIndex.php",
			data : {
				fun : "getViewerInfo",
				uid : B
			},
			success : function(C) {
				if (A) {
					A(C)
				}
			}
		})
	}
}
function getLimitedUserInfo(B, A) {
	if (B) {
		$.ajax({
			type : "post",
			url : "/api/svc/userIndex.php",
			data : {
				fun : "getUserInfo",
				uid : B
			},
			success : function(C) {
				if (A) {
					A(C)
				}
			}
		})
	}
}
function rtrim(A) {
	return A.replace(/[,\s+]$/g, "")
}
function Router() {
	this.id = 0;
	this.sn = "";
	this.name = "";
	this.usr = "";
	this.zigb = "";
	this.ip = ""
}
function Tester() {
	this.id = 0;
	this.sn = "";
	this.name = "";
	this.usr = "";
	this.ctrlSN = "";
	this.routerSN = "";
	this.roomType = 63;
	this.indoorFlag = 1;
	this.gisX = 0;
	this.gisY = 0;
	this.referSN = "";
	this.areaId = 0;
	this.province = "省";
	this.city = "市";
	this.county = "区"
}
function Controller() {
	this.id = 0;
	this.sn = "";
	this.name = "";
	this.zigb = "";
	this.routerSN = "";
	this.testerSN = "";
	this.passTesterSN = ""
}
function User() {
	this.id = 0;
	this.name = "";
	this.email = "";
	this.phone = "";
	this.alianame = "";
	this.father = "";
	this.areaId = "";
	this.province = "省";
	this.city = "市";
	this.county = "区"
};